<html xmlns="http://www.w3.org/1999/xhtml" >
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 <title>电脑站网页加载时间测试</title>
 <script type="text/javascript">
 var url = ["http://www.sina.com", "http://www.163.com", "http://www.youku.com", "http://www.taobao.com",""];
 var i = 0;
 var timeArray = new Array();
 var start = new Date();
 function loadPage(){
	setIframe(url[0]);
 }
 
 function setIframe(src){
	start = new Date(); 
	document.getElementById('iframe').src = src;
	document.getElementById('iframe').onload = getResult;
 }
 
 function getResult(){
	var end = new Date();
	var start_time = start.getTime();
	var start_str = "Start loading time: ";
	start_str = start_str + start.getFullYear()+"/";
	start_str = start_str + (start.getMonth()+1)+"/";
	start_str = start_str + start.getDate()+" ";
	start_str = start_str + start.getHours()+":";
	start_str = start_str + start.getMinutes()+":";
	start_str = start_str + start.getSeconds()+".";
	start_str = start_str + start.getMilliseconds();
	var end_time = end.getTime();
	var end_str = "Finish loading time: ";
	end_str = end_str + end.getFullYear()+"/";
	end_str = end_str + (end.getMonth()+1)+"/";
	end_str = end_str + end.getDate()+" ";
	end_str = end_str + end.getHours()+":";
	end_str = end_str + end.getMinutes()+":";
	end_str = end_str + end.getSeconds()+".";
	end_str = end_str + end.getMilliseconds();
	var period = "Full page load time: <b>"+(end_time - start_time)+"ms</b>";
	if(i != url.length -1){
		timeArray.push('<div><b>URL: ' + url[i] + '</b></div><div>'+ start_str +'</div><div>' + end_str +'</div><div>'+ period +'</div>');
		document.getElementById("show_time").innerHTML = timeArray;
	}
	if(i < url.length - 1){
		i++;
		setIframe(url[i]);
	}
 }

</script>

<body  onload=loadPage()>
<div id="show_time" ></div>
<iframe width="100%" height="100%" frameborder="no" border="0" id="iframe"></iframe>
</body>
</html>